package ogmios.components;
import javax.swing.filechooser.*;
import java.io.File;
/**
 * A file filter that will match any file that ends with the given extension, as well as directories, regardless of whether they contain the extension.
 */
public class OgmiosFilter extends FileFilter implements java.io.FileFilter
{
 public final String extension;
 public final String description;

 public OgmiosFilter(String fileExtension, String filterDescription)
 {
  extension = fileExtension;
  description = filterDescription;
 }
 public boolean accept(File f)
 {
  return f.isDirectory() || f.getName().toLowerCase().endsWith(extension);
 }
 public String getDescription()
 {
  return description;
 }

 public String toString()
 {
  return description;
 }
}
